import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:schedule_self_client/state_management/controller/new_app_download_controller.dart';
import 'package:schedule_self_client/utils/device_size_util.dart';

class DownloadLoadingPage extends StatefulWidget {
  final String title;

  const DownloadLoadingPage({super.key, required this.title});

  @override
  State<DownloadLoadingPage> createState() => _DownloadLoadingPageState();
}

class _DownloadLoadingPageState extends State<DownloadLoadingPage> {
  final NewAppDownloadController controller = Get.find();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // body: GetBuilder<NewAppDownloadController>(
      //   init: NewAppDownloadController(),
      //   builder: (s) => LinearProgressIndicator(
      //     value: s.count / s.total,
      //     semanticsLabel: widget.title,
      //   ),
      // ),
      body: Obx(() => Padding(
            padding: const EdgeInsets.all(16.0),
            child: Center(
              child: SizedBox(
                width: DeviceSizeUtil.getScreenWidth(context) * 0.4,
                height: DeviceSizeUtil.getScreenWidth(context) * 0.4,
                child: CircularProgressIndicator(
                  value: controller.count.value / controller.total.value,
                  strokeWidth: 8,
                ),
              ),
            ),
          )),
    );
  }
}
